/***************************************************************************
 创建者: 华磊
 开始时间: 2018.8.14
 copyright: (C) 华友高科
 修改说明: (每次有修改就添加一条，带有 修改人，修改时间，修改描述)
 example (1) hualei 2017.5.8 类的具体实现代码编写

 ***************************************************************************
 *  @file x.h
 *  功能:
 *
 *                                                                         *
 ***************************************************************************/
#ifndef HMIGSOAPQT_H
#define HMIGSOAPQT_H
#include "gSoapServer/gsoapserver.h"
#include "gSoapFoundation/soapH.h"
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <regex.h>
#include <QTimer>
#include <QDateTime>

#define HMI_GSOAP_PORT 5050        //端口号

//using namespace hmigsoapnamespace;


enum EM_WATCH_DOG{      //看门狗
    EM_FOOD_NONE,       //已吃
    EM_FOOD_FEED,       //喂狗
    EM_FOOD_END
};

#ifdef HMIGSOAPQT_LIBRARY
 #include "hmigsoapqt_global.h"
class HMIGSOAPQTSHARED_EXPORT HmiGsoapQt : public QObject
 #else
/**
 * @brief The HmiGsoapQt class gsoap实例类
 */
class  HmiGsoapQt : public QObject
#endif
{
    Q_OBJECT
public:
    HmiGsoapQt();
    ~HmiGsoapQt();
public:
    int readVersion(std::vector <ComponentVersion> &componentVersionList);
    //gsoap通信
    pthread_t tidUpdate;                //通信 更新用线程
    GsoapServer *gsoapServerObject;     //gsoap类  更新用
    bool initialGsoapServer();

//    //看门狗
//    int serverWatchDog;                 //看门狗 标志
//    int serverWatchDogSum;              //看门狗 累计
    std::string currentControllerIP;    //当前操作IP
//    void currentControllerToDog(std::string currentIP);     //当前控制运动(手动)异常监测
//    void clearControllerToDog(std::string currentIP);       //清除看门狗

//    QTimer *timerDog;
public slots:
    /**
     * @brief dogTimeWork
     */
//    void dogTimeWork();

private:
        ComponentVersion versionInfo;
};

#endif // HMIGSOAPQT_H
